home *** CD-ROM | disk | FTP | other *** search
/ Power Hacker 2003 / Power_Hacker_2003.iso / Exploit and vulnerability / w00w00 / exploits / tests / nis / proto / include / nis.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-08-13  |  26.7 KB  |  974 lines

  1. /*
  2.  * Please do not edit this file.
  3.  * It was generated using rpcgen.
  4.  */
  5.  
  6. #ifndef _NIS_H_RPCGEN
  7. #define _NIS_H_RPCGEN
  8.  
  9. #include <rpc/rpc.h>
  10.  
  11. /*
  12.  *    nis.h
  13.  *
  14.  *    This file is the main include file for NIS clients. It contains
  15.  *    both the client library function defines and the various data
  16.  *     structures used by the NIS service. It includes the file nis_tags.h
  17.  *    which defines the tag values. This allows the tags to change without
  18.  *    having to change the nis.x file.
  19.  *     
  20.  *    NOTE : DO NOT EDIT THIS FILE! It is automatically generated when
  21.  *           rpcgen is run on the nis.x file. Note that there is a 
  22.  *           simple sed script to remove some unneeded lines. (See the
  23.  *           Makefile target nis.h)
  24.  *
  25.  */
  26. #include <rpcsvc/nis_tags.h>
  27. #include <rpc/xdr.h>
  28. #pragma ident    "@(#)nis_object.x    1.7    92/07/14 SMI"
  29.  
  30. #ifndef __nis_object_h
  31. #define __nis_object_h
  32.  
  33. #define NIS_MAXSTRINGLEN 255
  34. #define NIS_MAXNAMELEN 1024
  35. #define NIS_MAXATTRNAME 32
  36. #define NIS_MAXATTRVAL 2048
  37. #define NIS_MAXCOLUMNS 64
  38. #define NIS_MAXATTR 16
  39. #define NIS_MAXPATH 1024
  40. #define NIS_MAXREPLICAS 128
  41. #define NIS_MAXLINKS 16
  42. #define NIS_PK_NONE 0
  43. #define NIS_PK_DH 1
  44. #define NIS_PK_RSA 2
  45. #define NIS_PK_KERB 3
  46.  
  47. struct nis_attr {
  48.     char *zattr_ndx;
  49.     struct {
  50.         u_int zattr_val_len;
  51.         char *zattr_val_val;
  52.     } zattr_val;
  53. };
  54. typedef struct nis_attr nis_attr;
  55. #ifdef __cplusplus 
  56. extern "C" bool_t xdr_nis_attr(XDR *, nis_attr*);
  57. #elif __STDC__ 
  58. extern  bool_t xdr_nis_attr(XDR *, nis_attr*);
  59. #else /* Old Style C */ 
  60. bool_t xdr_nis_attr();
  61. #endif /* Old Style C */ 
  62.  
  63.  
  64. typedef char *nis_name;
  65. #ifdef __cplusplus 
  66. extern "C" bool_t xdr_nis_name(XDR *, nis_name*);
  67. #elif __STDC__ 
  68. extern  bool_t xdr_nis_name(XDR *, nis_name*);
  69. #else /* Old Style C */ 
  70. bool_t xdr_nis_name();
  71. #endif /* Old Style C */ 
  72.  
  73.  
  74. enum zotypes {
  75.     BOGUS_OBJ = 0,
  76.     NO_OBJ = 1,
  77.     DIRECTORY_OBJ = 2,
  78.     GROUP_OBJ = 3,
  79.     TABLE_OBJ = 4,
  80.     ENTRY_OBJ = 5,
  81.     LINK_OBJ = 6,
  82.     PRIVATE_OBJ = 7,
  83. };
  84. typedef enum zotypes zotypes;
  85. #ifdef __cplusplus 
  86. extern "C" bool_t xdr_zotypes(XDR *, zotypes*);
  87. #elif __STDC__ 
  88. extern  bool_t xdr_zotypes(XDR *, zotypes*);
  89. #else /* Old Style C */ 
  90. bool_t xdr_zotypes();
  91. #endif /* Old Style C */ 
  92.  
  93.  
  94. enum nstype {
  95.     UNKNOWN = 0,
  96.     NIS = 1,
  97.     SUNYP = 2,
  98.     IVY = 3,
  99.     DNS = 4,
  100.     X500 = 5,
  101.     DNANS = 6,
  102.     XCHS = 7,
  103.     CDS = 8,
  104. };
  105. typedef enum nstype nstype;
  106. #ifdef __cplusplus 
  107. extern "C" bool_t xdr_nstype(XDR *, nstype*);
  108. #elif __STDC__ 
  109. extern  bool_t xdr_nstype(XDR *, nstype*);
  110. #else /* Old Style C */ 
  111. bool_t xdr_nstype();
  112. #endif /* Old Style C */ 
  113.  
  114.  
  115. struct oar_mask {
  116.     u_long oa_rights;
  117.     zotypes oa_otype;
  118. };
  119. typedef struct oar_mask oar_mask;
  120. #ifdef __cplusplus 
  121. extern "C" bool_t xdr_oar_mask(XDR *, oar_mask*);
  122. #elif __STDC__ 
  123. extern  bool_t xdr_oar_mask(XDR *, oar_mask*);
  124. #else /* Old Style C */ 
  125. bool_t xdr_oar_mask();
  126. #endif /* Old Style C */ 
  127.  
  128.  
  129. struct endpoint {
  130.     char *uaddr;
  131.     char *family;
  132.     char *proto;
  133. };
  134. typedef struct endpoint endpoint;
  135. #ifdef __cplusplus 
  136. extern "C" bool_t xdr_endpoint(XDR *, endpoint*);
  137. #elif __STDC__ 
  138. extern  bool_t xdr_endpoint(XDR *, endpoint*);
  139. #else /* Old Style C */ 
  140. bool_t xdr_endpoint();
  141. #endif /* Old Style C */ 
  142.  
  143.  
  144. struct nis_server {
  145.     nis_name name;
  146.     struct {
  147.         u_int ep_len;
  148.         endpoint *ep_val;
  149.     } ep;
  150.     u_long key_type;
  151.     netobj pkey;
  152. };
  153. typedef struct nis_server nis_server;
  154. #ifdef __cplusplus 
  155. extern "C" bool_t xdr_nis_server(XDR *, nis_server*);
  156. #elif __STDC__ 
  157. extern  bool_t xdr_nis_server(XDR *, nis_server*);
  158. #else /* Old Style C */ 
  159. bool_t xdr_nis_server();
  160. #endif /* Old Style C */ 
  161.  
  162.  
  163. struct directory_obj {
  164.     nis_name do_name;
  165.     nstype do_type;
  166.     struct {
  167.         u_int do_servers_len;
  168.         nis_server *do_servers_val;
  169.     } do_servers;
  170.     u_long do_ttl;
  171.     struct {
  172.         u_int do_armask_len;
  173.         oar_mask *do_armask_val;
  174.     } do_armask;
  175. };
  176. typedef struct directory_obj directory_obj;
  177. #ifdef __cplusplus 
  178. extern "C" bool_t xdr_directory_obj(XDR *, directory_obj*);
  179. #elif __STDC__ 
  180. extern  bool_t xdr_directory_obj(XDR *, directory_obj*);
  181. #else /* Old Style C */ 
  182. bool_t xdr_directory_obj();
  183. #endif /* Old Style C */ 
  184.  
  185. #define EN_BINARY 1
  186. #define EN_CRYPT 2
  187. #define EN_XDR 4
  188. #define EN_MODIFIED 8
  189. #define EN_ASN1 64
  190.  
  191. struct entry_col {
  192.     u_long ec_flags;
  193.     struct {
  194.         u_int ec_value_len;
  195.         char *ec_value_val;
  196.     } ec_value;
  197. };
  198. typedef struct entry_col entry_col;
  199. #ifdef __cplusplus 
  200. extern "C" bool_t xdr_entry_col(XDR *, entry_col*);
  201. #elif __STDC__ 
  202. extern  bool_t xdr_entry_col(XDR *, entry_col*);
  203. #else /* Old Style C */ 
  204. bool_t xdr_entry_col();
  205. #endif /* Old Style C */ 
  206.  
  207.  
  208. struct entry_obj {
  209.     char *en_type;
  210.     struct {
  211.         u_int en_cols_len;
  212.         entry_col *en_cols_val;
  213.     } en_cols;
  214. };
  215. typedef struct entry_obj entry_obj;
  216. #ifdef __cplusplus 
  217. extern "C" bool_t xdr_entry_obj(XDR *, entry_obj*);
  218. #elif __STDC__ 
  219. extern  bool_t xdr_entry_obj(XDR *, entry_obj*);
  220. #else /* Old Style C */ 
  221. bool_t xdr_entry_obj();
  222. #endif /* Old Style C */ 
  223.  
  224.  
  225. struct group_obj {
  226.     u_long gr_flags;
  227.     struct {
  228.         u_int gr_members_len;
  229.         nis_name *gr_members_val;
  230.     } gr_members;
  231. };
  232. typedef struct group_obj group_obj;
  233. #ifdef __cplusplus 
  234. extern "C" bool_t xdr_group_obj(XDR *, group_obj*);
  235. #elif __STDC__ 
  236. extern  bool_t xdr_group_obj(XDR *, group_obj*);
  237. #else /* Old Style C */ 
  238. bool_t xdr_group_obj();
  239. #endif /* Old Style C */ 
  240.  
  241.  
  242. struct link_obj {
  243.     zotypes li_rtype;
  244.     struct {
  245.         u_int li_attrs_len;
  246.         nis_attr *li_attrs_val;
  247.     } li_attrs;
  248.     nis_name li_name;
  249. };
  250. typedef struct link_obj link_obj;
  251. #ifdef __cplusplus 
  252. extern "C" bool_t xdr_link_obj(XDR *, link_obj*);
  253. #elif __STDC__ 
  254. extern  bool_t xdr_link_obj(XDR *, link_obj*);
  255. #else /* Old Style C */ 
  256. bool_t xdr_link_obj();
  257. #endif /* Old Style C */ 
  258.  
  259. #define TA_BINARY 1
  260. #define TA_CRYPT 2
  261. #define TA_XDR 4
  262. #define TA_SEARCHABLE 8
  263. #define TA_CASE 16
  264. #define TA_MODIFIED 32
  265. #define TA_ASN1 64
  266.  
  267. struct table_col {
  268.     char *tc_name;
  269.     u_long tc_flags;
  270.     u_long tc_rights;
  271. };
  272. typedef struct table_col table_col;
  273. #ifdef __cplusplus 
  274. extern "C" bool_t xdr_table_col(XDR *, table_col*);
  275. #elif __STDC__ 
  276. extern  bool_t xdr_table_col(XDR *, table_col*);
  277. #else /* Old Style C */ 
  278. bool_t xdr_table_col();
  279. #endif /* Old Style C */ 
  280.  
  281.  
  282. struct table_obj {
  283.     char *ta_type;
  284.     int ta_maxcol;
  285.     u_char ta_sep;
  286.     struct {
  287.         u_int ta_cols_len;
  288.         table_col *ta_cols_val;
  289.     } ta_cols;
  290.     char *ta_path;
  291. };
  292. typedef struct table_obj table_obj;
  293. #ifdef __cplusplus 
  294. extern "C" bool_t xdr_table_obj(XDR *, table_obj*);
  295. #elif __STDC__ 
  296. extern  bool_t xdr_table_obj(XDR *, table_obj*);
  297. #else /* Old Style C */ 
  298. bool_t xdr_table_obj();
  299. #endif /* Old Style C */ 
  300.  
  301.  
  302. struct objdata {
  303.     zotypes zo_type;
  304.     union {
  305.         struct directory_obj di_data;
  306.         struct group_obj gr_data;
  307.         struct table_obj ta_data;
  308.         struct entry_obj en_data;
  309.         struct link_obj li_data;
  310.         struct {
  311.             u_int po_data_len;
  312.             char *po_data_val;
  313.         } po_data;
  314.     } objdata_u;
  315. };
  316. typedef struct objdata objdata;
  317. #ifdef __cplusplus 
  318. extern "C" bool_t xdr_objdata(XDR *, objdata*);
  319. #elif __STDC__ 
  320. extern  bool_t xdr_objdata(XDR *, objdata*);
  321. #else /* Old Style C */ 
  322. bool_t xdr_objdata();
  323. #endif /* Old Style C */ 
  324.  
  325.  
  326. struct nis_oid {
  327.     u_long ctime;
  328.     u_long mtime;
  329. };
  330. typedef struct nis_oid nis_oid;
  331. #ifdef __cplusplus 
  332. extern "C" bool_t xdr_nis_oid(XDR *, nis_oid*);
  333. #elif __STDC__ 
  334. extern  bool_t xdr_nis_oid(XDR *, nis_oid*);
  335. #else /* Old Style C */ 
  336. bool_t xdr_nis_oid();
  337. #endif /* Old Style C */ 
  338.  
  339.  
  340. struct nis_object {
  341.     nis_oid zo_oid;
  342.     nis_name zo_name;
  343.     nis_name zo_owner;
  344.     nis_name zo_group;
  345.     nis_name zo_domain;
  346.     u_long zo_access;
  347.     u_long zo_ttl;
  348.     objdata zo_data;
  349. };
  350. typedef struct nis_object nis_object;
  351. #ifdef __cplusplus 
  352. extern "C" bool_t xdr_nis_object(XDR *, nis_object*);
  353. #elif __STDC__ 
  354. extern  bool_t xdr_nis_object(XDR *, nis_object*);
  355. #else /* Old Style C */ 
  356. bool_t xdr_nis_object();
  357. #endif /* Old Style C */ 
  358.  
  359.  
  360. #endif /* if __nis_object_h */
  361.  
  362.  
  363. enum nis_error {
  364.     NIS_SUCCESS = 0,
  365.     NIS_S_SUCCESS = 1,
  366.     NIS_NOTFOUND = 2,
  367.     NIS_S_NOTFOUND = 3,
  368.     NIS_CACHEEXPIRED = 4,
  369.     NIS_NAMEUNREACHABLE = 5,
  370.     NIS_UNKNOWNOBJ = 6,
  371.     NIS_TRYAGAIN = 7,
  372.     NIS_SYSTEMERROR = 8,
  373.     NIS_CHAINBROKEN = 9,
  374.     NIS_PERMISSION = 10,
  375.     NIS_NOTOWNER = 11,
  376.     NIS_NOT_ME = 12,
  377.     NIS_NOMEMORY = 13,
  378.     NIS_NAMEEXISTS = 14,
  379.     NIS_NOTMASTER = 15,
  380.     NIS_INVALIDOBJ = 16,
  381.     NIS_BADNAME = 17,
  382.     NIS_NOCALLBACK = 18,
  383.     NIS_CBRESULTS = 19,
  384.     NIS_NOSUCHNAME = 20,
  385.     NIS_NOTUNIQUE = 21,
  386.     NIS_IBMODERROR = 22,
  387.     NIS_NOSUCHTABLE = 23,
  388.     NIS_TYPEMISMATCH = 24,
  389.     NIS_LINKNAMEERROR = 25,
  390.     NIS_PARTIAL = 26,
  391.     NIS_TOOMANYATTRS = 27,
  392.     NIS_RPCERROR = 28,
  393.     NIS_BADATTRIBUTE = 29,
  394.     NIS_NOTSEARCHABLE = 30,
  395.     NIS_CBERROR = 31,
  396.     NIS_FOREIGNNS = 32,
  397.     NIS_BADOBJECT = 33,
  398.     NIS_NOTSAMEOBJ = 34,
  399.     NIS_MODFAIL = 35,
  400.     NIS_BADREQUEST = 36,
  401.     NIS_NOTEMPTY = 37,
  402.     NIS_COLDSTART_ERR = 38,
  403.     NIS_RESYNC = 39,
  404.     NIS_FAIL = 40,
  405.     NIS_UNAVAIL = 41,
  406.     NIS_RES2BIG = 42,
  407.     NIS_SRVAUTH = 43,
  408.     NIS_CLNTAUTH = 44,
  409.     NIS_NOFILESPACE = 45,
  410.     NIS_NOPROC = 46,
  411.     NIS_DUMPLATER = 47,
  412. };
  413. typedef enum nis_error nis_error;
  414. #ifdef __cplusplus 
  415. extern "C" bool_t xdr_nis_error(XDR *, nis_error*);
  416. #elif __STDC__ 
  417. extern  bool_t xdr_nis_error(XDR *, nis_error*);
  418. #else /* Old Style C */ 
  419. bool_t xdr_nis_error();
  420. #endif /* Old Style C */ 
  421.  
  422.  
  423. struct nis_result {
  424.     nis_error status;
  425.     struct {
  426.         u_int objects_len;
  427.         nis_object *objects_val;
  428.     } objects;
  429.     netobj cookie;
  430.     u_long zticks;
  431.     u_long dticks;
  432.     u_long aticks;
  433.     u_long cticks;
  434. };
  435. typedef struct nis_result nis_result;
  436. #ifdef __cplusplus 
  437. extern "C" bool_t xdr_nis_result(XDR *, nis_result*);
  438. #elif __STDC__ 
  439. extern  bool_t xdr_nis_result(XDR *, nis_result*);
  440. #else /* Old Style C */ 
  441. bool_t xdr_nis_result();
  442. #endif /* Old Style C */ 
  443.  
  444.  
  445. struct ns_request {
  446.     nis_name ns_name;
  447.     struct {
  448.         u_int ns_object_len;
  449.         nis_object *ns_object_val;
  450.     } ns_object;
  451. };
  452. typedef struct ns_request ns_request;
  453. #ifdef __cplusplus 
  454. extern "C" bool_t xdr_ns_request(XDR *, ns_request*);
  455. #elif __STDC__ 
  456. extern  bool_t xdr_ns_request(XDR *, ns_request*);
  457. #else /* Old Style C */ 
  458. bool_t xdr_ns_request();
  459. #endif /* Old Style C */ 
  460.  
  461.  
  462. struct ib_request {
  463.     nis_name ibr_name;
  464.     struct {
  465.         u_int ibr_srch_len;
  466.         nis_attr *ibr_srch_val;
  467.     } ibr_srch;
  468.     u_long ibr_flags;
  469.     struct {
  470.         u_int ibr_obj_len;
  471.         nis_object *ibr_obj_val;
  472.     } ibr_obj;
  473.     struct {
  474.         u_int ibr_cbhost_len;
  475.         nis_server *ibr_cbhost_val;
  476.     } ibr_cbhost;
  477.     u_long ibr_bufsize;
  478.     netobj ibr_cookie;
  479. };
  480. typedef struct ib_request ib_request;
  481. #ifdef __cplusplus 
  482. extern "C" bool_t xdr_ib_request(XDR *, ib_request*);
  483. #elif __STDC__ 
  484. extern  bool_t xdr_ib_request(XDR *, ib_request*);
  485. #else /* Old Style C */ 
  486. bool_t xdr_ib_request();
  487. #endif /* Old Style C */ 
  488.  
  489.  
  490. struct ping_args {
  491.     nis_name dir;
  492.     u_long stamp;
  493. };
  494. typedef struct ping_args ping_args;
  495. #ifdef __cplusplus 
  496. extern "C" bool_t xdr_ping_args(XDR *, ping_args*);
  497. #elif __STDC__ 
  498. extern  bool_t xdr_ping_args(XDR *, ping_args*);
  499. #else /* Old Style C */ 
  500. bool_t xdr_ping_args();
  501. #endif /* Old Style C */ 
  502.  
  503.  
  504. enum log_entry_t {
  505.     LOG_NOP = 0,
  506.     ADD_NAME = 1,
  507.     REM_NAME = 2,
  508.     MOD_NAME_OLD = 3,
  509.     MOD_NAME_NEW = 4,
  510.     ADD_IBASE = 5,
  511.     REM_IBASE = 6,
  512.     MOD_IBASE = 7,
  513.     UPD_STAMP = 8,
  514. };
  515. typedef enum log_entry_t log_entry_t;
  516. #ifdef __cplusplus 
  517. extern "C" bool_t xdr_log_entry_t(XDR *, log_entry_t*);
  518. #elif __STDC__ 
  519. extern  bool_t xdr_log_entry_t(XDR *, log_entry_t*);
  520. #else /* Old Style C */ 
  521. bool_t xdr_log_entry_t();
  522. #endif /* Old Style C */ 
  523.  
  524.  
  525. struct log_entry {
  526.     u_long le_time;
  527.     log_entry_t le_type;
  528.     nis_name le_princp;
  529.     nis_name le_name;
  530.     struct {
  531.         u_int le_attrs_len;
  532.         nis_attr *le_attrs_val;
  533.     } le_attrs;
  534.     nis_object le_object;
  535. };
  536. typedef struct log_entry log_entry;
  537. #ifdef __cplusplus 
  538. extern "C" bool_t xdr_log_entry(XDR *, log_entry*);
  539. #elif __STDC__ 
  540. extern  bool_t xdr_log_entry(XDR *, log_entry*);
  541. #else /* Old Style C */ 
  542. bool_t xdr_log_entry();
  543. #endif /* Old Style C */ 
  544.  
  545.  
  546. struct log_result {
  547.     nis_error lr_status;
  548.     netobj lr_cookie;
  549.     struct {
  550.         u_int lr_entries_len;
  551.         log_entry *lr_entries_val;
  552.     } lr_entries;
  553. };
  554. typedef struct log_result log_result;
  555. #ifdef __cplusplus 
  556. extern "C" bool_t xdr_log_result(XDR *, log_result*);
  557. #elif __STDC__ 
  558. extern  bool_t xdr_log_result(XDR *, log_result*);
  559. #else /* Old Style C */ 
  560. bool_t xdr_log_result();
  561. #endif /* Old Style C */ 
  562.  
  563.  
  564. struct cp_result {
  565.     nis_error cp_status;
  566.     u_long cp_zticks;
  567.     u_long cp_dticks;
  568. };
  569. typedef struct cp_result cp_result;
  570. #ifdef __cplusplus 
  571. extern "C" bool_t xdr_cp_result(XDR *, cp_result*);
  572. #elif __STDC__ 
  573. extern  bool_t xdr_cp_result(XDR *, cp_result*);
  574. #else /* Old Style C */ 
  575. bool_t xdr_cp_result();
  576. #endif /* Old Style C */ 
  577.  
  578.  
  579. struct nis_tag {
  580.     u_long tag_type;
  581.     char *tag_val;
  582. };
  583. typedef struct nis_tag nis_tag;
  584. #ifdef __cplusplus 
  585. extern "C" bool_t xdr_nis_tag(XDR *, nis_tag*);
  586. #elif __STDC__ 
  587. extern  bool_t xdr_nis_tag(XDR *, nis_tag*);
  588. #else /* Old Style C */ 
  589. bool_t xdr_nis_tag();
  590. #endif /* Old Style C */ 
  591.  
  592.  
  593. struct nis_taglist {
  594.     struct {
  595.         u_int tags_len;
  596.         nis_tag *tags_val;
  597.     } tags;
  598. };
  599. typedef struct nis_taglist nis_taglist;
  600. #ifdef __cplusplus 
  601. extern "C" bool_t xdr_nis_taglist(XDR *, nis_taglist*);
  602. #elif __STDC__ 
  603. extern  bool_t xdr_nis_taglist(XDR *, nis_taglist*);
  604. #else /* Old Style C */ 
  605. bool_t xdr_nis_taglist();
  606. #endif /* Old Style C */ 
  607.  
  608.  
  609. struct dump_args {
  610.     nis_name da_dir;
  611.     u_long da_time;
  612.     struct {
  613.         u_int da_cbhost_len;
  614.         nis_server *da_cbhost_val;
  615.     } da_cbhost;
  616. };
  617. typedef struct dump_args dump_args;
  618. #ifdef __cplusplus 
  619. extern "C" bool_t xdr_dump_args(XDR *, dump_args*);
  620. #elif __STDC__ 
  621. extern  bool_t xdr_dump_args(XDR *, dump_args*);
  622. #else /* Old Style C */ 
  623. bool_t xdr_dump_args();
  624. #endif /* Old Style C */ 
  625.  
  626.  
  627. struct fd_args {
  628.     nis_name dir_name;
  629.     nis_name requester;
  630. };
  631. typedef struct fd_args fd_args;
  632. #ifdef __cplusplus 
  633. extern "C" bool_t xdr_fd_args(XDR *, fd_args*);
  634. #elif __STDC__ 
  635. extern  bool_t xdr_fd_args(XDR *, fd_args*);
  636. #else /* Old Style C */ 
  637. bool_t xdr_fd_args();
  638. #endif /* Old Style C */ 
  639.  
  640.  
  641. struct fd_result {
  642.     nis_error status;
  643.     nis_name source;
  644.     struct {
  645.         u_int dir_data_len;
  646.         char *dir_data_val;
  647.     } dir_data;
  648.     struct {
  649.         u_int signature_len;
  650.         char *signature_val;
  651.     } signature;
  652. };
  653. typedef struct fd_result fd_result;
  654. #ifdef __cplusplus 
  655. extern "C" bool_t xdr_fd_result(XDR *, fd_result*);
  656. #elif __STDC__ 
  657. extern  bool_t xdr_fd_result(XDR *, fd_result*);
  658. #else /* Old Style C */ 
  659. bool_t xdr_fd_result();
  660. #endif /* Old Style C */ 
  661.  
  662. /*
  663.  * Generic "hash" datastructures, used by all types of hashed data.
  664.  */
  665. struct nis_hash_data {
  666.     nis_name        name;       /* NIS name of hashed item      */
  667.     int            keychain;  /* It's hash key (for pop)      */
  668.     struct nis_hash_data    *next;       /* Hash collision pointer       */
  669.     struct nis_hash_data    *prv_item; /* A serial, doubly linked list */
  670.     struct nis_hash_data    *nxt_item; /* of items in the hash table   */
  671. };
  672. typedef struct nis_hash_data NIS_HASH_ITEM;
  673.  
  674. struct nis_hash_table {
  675.     NIS_HASH_ITEM    *keys[64];    /* A hash table of items           */
  676.     NIS_HASH_ITEM    *first;        /* The first "item" in serial list */
  677. };
  678. typedef struct nis_hash_table NIS_HASH_TABLE;
  679.  
  680. /* Structure for storing dynamically allocated static data */
  681. struct nis_sdata {
  682.     void    *buf;    /* Memory allocation pointer     */
  683.     u_long    size;    /* Buffer size            */
  684. };
  685.  
  686. /* Generic client creating flags */
  687. #define ZMH_VC        1
  688. #define ZMH_DG        2
  689. #define ZMH_AUTH    4
  690.  
  691. /* Testing Access rights for objects */
  692.  
  693. #define NIS_READ_ACC        1
  694. #define NIS_MODIFY_ACC        2
  695. #define NIS_CREATE_ACC        4
  696. #define NIS_DESTROY_ACC    8
  697. /* Test macros. a == access rights, m == desired rights. */
  698. #define WORLD(a, m)    (((a) & (m)) != 0)
  699. #define GROUP(a, m)    (((a) & ((m) << 8)) != 0)
  700. #define OWNER(a, m)    (((a) & ((m) << 16)) != 0)
  701. #define NOBODY(a, m)    (((a) & ((m) << 24)) != 0)
  702.  
  703. #define OATYPE(d, n) (((d)->do_armask.do_armask_val+n)->oa_otype)
  704. #define OARIGHTS(d, n) (((d)->do_armask.do_armask_val+n)->oa_rights)
  705. #define WORLD_DEFAULT (NIS_READ_ACC)
  706. #define GROUP_DEFAULT (NIS_READ_ACC << 8)
  707. #define OWNER_DEFAULT ((NIS_READ_ACC +%             NIS_MODIFY_ACC +%             NIS_CREATE_ACC +%             NIS_DESTROY_ACC) << 16)
  708. #define DEFAULT_RIGHTS (WORLD_DEFAULT | GROUP_DEFAULT | OWNER_DEFAULT)
  709.  
  710. /* Result manipulation defines ... */
  711. #define NIS_RES_NUMOBJ(x)    ((x)->objects.objects_len)
  712. #define NIS_RES_OBJECT(x)    ((x)->objects.objects_val)
  713. #define NIS_RES_COOKIE(x)    ((x)->cookie)
  714. #define NIS_RES_STATUS(x)    ((x)->status)
  715.  
  716. /* These defines make getting at the variant part of the object easier. */
  717. #define TA_data zo_data.objdata_u.ta_data
  718. #define EN_data zo_data.objdata_u.en_data
  719. #define DI_data zo_data.objdata_u.di_data
  720. #define LI_data zo_data.objdata_u.li_data
  721. #define GR_data zo_data.objdata_u.gr_data
  722.  
  723. #define __type_of(o) ((o)->zo_data.zo_type)
  724.  
  725. /* Declarations for the internal subroutines in nislib.c */
  726. enum name_pos {SAME_NAME, HIGHER_NAME, LOWER_NAME, NOT_SEQUENTIAL, BAD_NAME};
  727. typedef enum name_pos name_pos;
  728.  
  729. /*
  730.  * Defines for getting at column data in entry objects. Because RPCGEN
  731.  * generates some rather wordy structures, we create some defines that
  732.  * collapse the needed keystrokes to access a particular value using
  733.  * these definitions they take an nis_object *, and an int and return
  734.  * a u_char * for Value, and an int for length.
  735.  */
  736. #define ENTRY_VAL(obj, col) %    (obj)->EN_data.en_cols.en_cols_val[col].ec_value.ec_value_val
  737. #define ENTRY_LEN(obj, col) %    (obj)->EN_data.en_cols.en_cols_val[col].ec_value.ec_value_len
  738.  
  739. #ifdef __cplusplus
  740. }
  741. #endif
  742.  
  743. /* Prototypes, and extern declarations for the NIS library functions. */
  744. #include <rpcsvc/nislib.h>
  745. #endif /* __NIS_RPCGEN_H */
  746. /* EDIT_START */
  747.  
  748. /*
  749.  * nis_3.h
  750.  * 
  751.  * This file contains definitions that are only of interest to the actual
  752.  * service daemon and client stubs. Normal users of NIS will not include
  753.  * this file.
  754.  *
  755.  * NOTE : This include file is automatically created by a combination 
  756.  * of rpcgen and sed. DO NOT EDIT IT, change the nis.x file instead
  757.  * and then remake this file.
  758.  */
  759. #ifndef __nis_3_h
  760. #define __nis_3_h
  761. #ifdef __cplusplus
  762. extern "C" {
  763. #endif
  764.  
  765. #define NIS_PROG ((u_long)100300)
  766. #define NIS_VERSION ((u_long)3)
  767.  
  768. #ifdef __cplusplus
  769. #define NIS_LOOKUP ((u_long)1)
  770. extern "C" nis_result * nis_lookup_3(ns_request *, CLIENT *);
  771. extern "C" nis_result * nis_lookup_3_svc(ns_request *, struct svc_req *);
  772. #define NIS_ADD ((u_long)2)
  773. extern "C" nis_result * nis_add_3(ns_request *, CLIENT *);
  774. extern "C" nis_result * nis_add_3_svc(ns_request *, struct svc_req *);
  775. #define NIS_MODIFY ((u_long)3)
  776. extern "C" nis_result * nis_modify_3(ns_request *, CLIENT *);
  777. extern "C" nis_result * nis_modify_3_svc(ns_request *, struct svc_req *);
  778. #define NIS_REMOVE ((u_long)4)
  779. extern "C" nis_result * nis_remove_3(ns_request *, CLIENT *);
  780. extern "C" nis_result * nis_remove_3_svc(ns_request *, struct svc_req *);
  781. #define NIS_IBLIST ((u_long)5)
  782. extern "C" nis_result * nis_iblist_3(ib_request *, CLIENT *);
  783. extern "C" nis_result * nis_iblist_3_svc(ib_request *, struct svc_req *);
  784. #define NIS_IBADD ((u_long)6)
  785. extern "C" nis_result * nis_ibadd_3(ib_request *, CLIENT *);
  786. extern "C" nis_result * nis_ibadd_3_svc(ib_request *, struct svc_req *);
  787. #define NIS_IBMODIFY ((u_long)7)
  788. extern "C" nis_result * nis_ibmodify_3(ib_request *, CLIENT *);
  789. extern "C" nis_result * nis_ibmodify_3_svc(ib_request *, struct svc_req *);
  790. #define NIS_IBREMOVE ((u_long)8)
  791. extern "C" nis_result * nis_ibremove_3(ib_request *, CLIENT *);
  792. extern "C" nis_result * nis_ibremove_3_svc(ib_request *, struct svc_req *);
  793. #define NIS_IBFIRST ((u_long)9)
  794. extern "C" nis_result * nis_ibfirst_3(ib_request *, CLIENT *);
  795. extern "C" nis_result * nis_ibfirst_3_svc(ib_request *, struct svc_req *);
  796. #define NIS_IBNEXT ((u_long)10)
  797. extern "C" nis_result * nis_ibnext_3(ib_request *, CLIENT *);
  798. extern "C" nis_result * nis_ibnext_3_svc(ib_request *, struct svc_req *);
  799. #define NIS_FINDDIRECTORY ((u_long)12)
  800. extern "C" fd_result * nis_finddirectory_3(fd_args *, CLIENT *);
  801. extern "C" fd_result * nis_finddirectory_3_svc(fd_args *, struct svc_req *);
  802. #define NIS_STATUS ((u_long)14)
  803. extern "C" nis_taglist * nis_status_3(nis_taglist *, CLIENT *);
  804. extern "C" nis_taglist * nis_status_3_svc(nis_taglist *, struct svc_req *);
  805. #define NIS_DUMPLOG ((u_long)15)
  806. extern "C" log_result * nis_dumplog_3(dump_args *, CLIENT *);
  807. extern "C" log_result * nis_dumplog_3_svc(dump_args *, struct svc_req *);
  808. #define NIS_DUMP ((u_long)16)
  809. extern "C" log_result * nis_dump_3(dump_args *, CLIENT *);
  810. extern "C" log_result * nis_dump_3_svc(dump_args *, struct svc_req *);
  811. #define NIS_CALLBACK ((u_long)17)
  812. extern "C" bool_t * nis_callback_3(netobj *, CLIENT *);
  813. extern "C" bool_t * nis_callback_3_svc(netobj *, struct svc_req *);
  814. #define NIS_CPTIME ((u_long)18)
  815. extern "C" u_long * nis_cptime_3(nis_name *, CLIENT *);
  816. extern "C" u_long * nis_cptime_3_svc(nis_name *, struct svc_req *);
  817. #define NIS_CHECKPOINT ((u_long)19)
  818. extern "C" cp_result * nis_checkpoint_3(nis_name *, CLIENT *);
  819. extern "C" cp_result * nis_checkpoint_3_svc(nis_name *, struct svc_req *);
  820. #define NIS_PING ((u_long)20)
  821. extern "C" void * nis_ping_3(ping_args *, CLIENT *);
  822. extern "C" void * nis_ping_3_svc(ping_args *, struct svc_req *);
  823. #define NIS_SERVSTATE ((u_long)21)
  824. extern "C" nis_taglist * nis_servstate_3(nis_taglist *, CLIENT *);
  825. extern "C" nis_taglist * nis_servstate_3_svc(nis_taglist *, struct svc_req *);
  826. #define NIS_MKDIR ((u_long)22)
  827. extern "C" nis_error * nis_mkdir_3(nis_name *, CLIENT *);
  828. extern "C" nis_error * nis_mkdir_3_svc(nis_name *, struct svc_req *);
  829. #define NIS_RMDIR ((u_long)23)
  830. extern "C" nis_error * nis_rmdir_3(nis_name *, CLIENT *);
  831. extern "C" nis_error * nis_rmdir_3_svc(nis_name *, struct svc_req *);
  832. #define NIS_UPDKEYS ((u_long)24)
  833. extern "C" nis_error * nis_updkeys_3(nis_name *, CLIENT *);
  834. extern "C" nis_error * nis_updkeys_3_svc(nis_name *, struct svc_req *);
  835.  
  836. #elif __STDC__
  837. #define NIS_LOOKUP ((u_long)1)
  838. extern  nis_result * nis_lookup_3(ns_request *, CLIENT *);
  839. extern  nis_result * nis_lookup_3_svc(ns_request *, struct svc_req *);
  840. #define NIS_ADD ((u_long)2)
  841. extern  nis_result * nis_add_3(ns_request *, CLIENT *);
  842. extern  nis_result * nis_add_3_svc(ns_request *, struct svc_req *);
  843. #define NIS_MODIFY ((u_long)3)
  844. extern  nis_result * nis_modify_3(ns_request *, CLIENT *);
  845. extern  nis_result * nis_modify_3_svc(ns_request *, struct svc_req *);
  846. #define NIS_REMOVE ((u_long)4)
  847. extern  nis_result * nis_remove_3(ns_request *, CLIENT *);
  848. extern  nis_result * nis_remove_3_svc(ns_request *, struct svc_req *);
  849. #define NIS_IBLIST ((u_long)5)
  850. extern  nis_result * nis_iblist_3(ib_request *, CLIENT *);
  851. extern  nis_result * nis_iblist_3_svc(ib_request *, struct svc_req *);
  852. #define NIS_IBADD ((u_long)6)
  853. extern  nis_result * nis_ibadd_3(ib_request *, CLIENT *);
  854. extern  nis_result * nis_ibadd_3_svc(ib_request *, struct svc_req *);
  855. #define NIS_IBMODIFY ((u_long)7)
  856. extern  nis_result * nis_ibmodify_3(ib_request *, CLIENT *);
  857. extern  nis_result * nis_ibmodify_3_svc(ib_request *, struct svc_req *);
  858. #define NIS_IBREMOVE ((u_long)8)
  859. extern  nis_result * nis_ibremove_3(ib_request *, CLIENT *);
  860. extern  nis_result * nis_ibremove_3_svc(ib_request *, struct svc_req *);
  861. #define NIS_IBFIRST ((u_long)9)
  862. extern  nis_result * nis_ibfirst_3(ib_request *, CLIENT *);
  863. extern  nis_result * nis_ibfirst_3_svc(ib_request *, struct svc_req *);
  864. #define NIS_IBNEXT ((u_long)10)
  865. extern  nis_result * nis_ibnext_3(ib_request *, CLIENT *);
  866. extern  nis_result * nis_ibnext_3_svc(ib_request *, struct svc_req *);
  867. #define NIS_FINDDIRECTORY ((u_long)12)
  868. extern  fd_result * nis_finddirectory_3(fd_args *, CLIENT *);
  869. extern  fd_result * nis_finddirectory_3_svc(fd_args *, struct svc_req *);
  870. #define NIS_STATUS ((u_long)14)
  871. extern  nis_taglist * nis_status_3(nis_taglist *, CLIENT *);
  872. extern  nis_taglist * nis_status_3_svc(nis_taglist *, struct svc_req *);
  873. #define NIS_DUMPLOG ((u_long)15)
  874. extern  log_result * nis_dumplog_3(dump_args *, CLIENT *);
  875. extern  log_result * nis_dumplog_3_svc(dump_args *, struct svc_req *);
  876. #define NIS_DUMP ((u_long)16)
  877. extern  log_result * nis_dump_3(dump_args *, CLIENT *);
  878. extern  log_result * nis_dump_3_svc(dump_args *, struct svc_req *);
  879. #define NIS_CALLBACK ((u_long)17)
  880. extern  bool_t * nis_callback_3(netobj *, CLIENT *);
  881. extern  bool_t * nis_callback_3_svc(netobj *, struct svc_req *);
  882. #define NIS_CPTIME ((u_long)18)
  883. extern  u_long * nis_cptime_3(nis_name *, CLIENT *);
  884. extern  u_long * nis_cptime_3_svc(nis_name *, struct svc_req *);
  885. #define NIS_CHECKPOINT ((u_long)19)
  886. extern  cp_result * nis_checkpoint_3(nis_name *, CLIENT *);
  887. extern  cp_result * nis_checkpoint_3_svc(nis_name *, struct svc_req *);
  888. #define NIS_PING ((u_long)20)
  889. extern  void * nis_ping_3(ping_args *, CLIENT *);
  890. extern  void * nis_ping_3_svc(ping_args *, struct svc_req *);
  891. #define NIS_SERVSTATE ((u_long)21)
  892. extern  nis_taglist * nis_servstate_3(nis_taglist *, CLIENT *);
  893. extern  nis_taglist * nis_servstate_3_svc(nis_taglist *, struct svc_req *);
  894. #define NIS_MKDIR ((u_long)22)
  895. extern  nis_error * nis_mkdir_3(nis_name *, CLIENT *);
  896. extern  nis_error * nis_mkdir_3_svc(nis_name *, struct svc_req *);
  897. #define NIS_RMDIR ((u_long)23)
  898. extern  nis_error * nis_rmdir_3(nis_name *, CLIENT *);
  899. extern  nis_error * nis_rmdir_3_svc(nis_name *, struct svc_req *);
  900. #define NIS_UPDKEYS ((u_long)24)
  901. extern  nis_error * nis_updkeys_3(nis_name *, CLIENT *);
  902. extern  nis_error * nis_updkeys_3_svc(nis_name *, struct svc_req *);
  903.  
  904. #else /* Old Style C */ 
  905. #define NIS_LOOKUP ((u_long)1)
  906. extern  nis_result * nis_lookup_3();
  907. extern  nis_result * nis_lookup_3_svc();
  908. #define NIS_ADD ((u_long)2)
  909. extern  nis_result * nis_add_3();
  910. extern  nis_result * nis_add_3_svc();
  911. #define NIS_MODIFY ((u_long)3)
  912. extern  nis_result * nis_modify_3();
  913. extern  nis_result * nis_modify_3_svc();
  914. #define NIS_REMOVE ((u_long)4)
  915. extern  nis_result * nis_remove_3();
  916. extern  nis_result * nis_remove_3_svc();
  917. #define NIS_IBLIST ((u_long)5)
  918. extern  nis_result * nis_iblist_3();
  919. extern  nis_result * nis_iblist_3_svc();
  920. #define NIS_IBADD ((u_long)6)
  921. extern  nis_result * nis_ibadd_3();
  922. extern  nis_result * nis_ibadd_3_svc();
  923. #define NIS_IBMODIFY ((u_long)7)
  924. extern  nis_result * nis_ibmodify_3();
  925. extern  nis_result * nis_ibmodify_3_svc();
  926. #define NIS_IBREMOVE ((u_long)8)
  927. extern  nis_result * nis_ibremove_3();
  928. extern  nis_result * nis_ibremove_3_svc();
  929. #define NIS_IBFIRST ((u_long)9)
  930. extern  nis_result * nis_ibfirst_3();
  931. extern  nis_result * nis_ibfirst_3_svc();
  932. #define NIS_IBNEXT ((u_long)10)
  933. extern  nis_result * nis_ibnext_3();
  934. extern  nis_result * nis_ibnext_3_svc();
  935. #define NIS_FINDDIRECTORY ((u_long)12)
  936. extern  fd_result * nis_finddirectory_3();
  937. extern  fd_result * nis_finddirectory_3_svc();
  938. #define NIS_STATUS ((u_long)14)
  939. extern  nis_taglist * nis_status_3();
  940. extern  nis_taglist * nis_status_3_svc();
  941. #define NIS_DUMPLOG ((u_long)15)
  942. extern  log_result * nis_dumplog_3();
  943. extern  log_result * nis_dumplog_3_svc();
  944. #define NIS_DUMP ((u_long)16)
  945. extern  log_result * nis_dump_3();
  946. extern  log_result * nis_dump_3_svc();
  947. #define NIS_CALLBACK ((u_long)17)
  948. extern  bool_t * nis_callback_3();
  949. extern  bool_t * nis_callback_3_svc();
  950. #define NIS_CPTIME ((u_long)18)
  951. extern  u_long * nis_cptime_3();
  952. extern  u_long * nis_cptime_3_svc();
  953. #define NIS_CHECKPOINT ((u_long)19)
  954. extern  cp_result * nis_checkpoint_3();
  955. extern  cp_result * nis_checkpoint_3_svc();
  956. #define NIS_PING ((u_long)20)
  957. extern  void * nis_ping_3();
  958. extern  void * nis_ping_3_svc();
  959. #define NIS_SERVSTATE ((u_long)21)
  960. extern  nis_taglist * nis_servstate_3();
  961. extern  nis_taglist * nis_servstate_3_svc();
  962. #define NIS_MKDIR ((u_long)22)
  963. extern  nis_error * nis_mkdir_3();
  964. extern  nis_error * nis_mkdir_3_svc();
  965. #define NIS_RMDIR ((u_long)23)
  966. extern  nis_error * nis_rmdir_3();
  967. extern  nis_error * nis_rmdir_3_svc();
  968. #define NIS_UPDKEYS ((u_long)24)
  969. extern  nis_error * nis_updkeys_3();
  970. extern  nis_error * nis_updkeys_3_svc();
  971. #endif /* Old Style C */ 
  972.  
  973. #endif /* !_NIS_H_RPCGEN */
  974.